<div class="col-lg-6">
  <div class="panel panel-primary">
    <div class="panel-heading">聚合用户</div>
    <div class="panel-body" ng-init="send('spider.user.index', {})">
      <p>此处仅显示已经注册的用户及个人待办抓取服务的运行状态。</p>

      <div class="row container-fluid">
        <hr>
        <div class="well col-lg-8">
          <p><b>状态图示说明</b></p>
          <table>
            <col style="width: 10%;"></col>
            <tr>
              <td><i style="padding-right: 2em;" class="fa fa-play"></i></td>
              <td><span>个人待办抓取服务正在运行</span></td>
            </tr>

            <tr class="text-warning">
              <td><i style="padding-right: 2em;" class="fa fa-pause"></i></td>
              <td><span>个人待办抓取服务没有运行，这有可能是因为服务没有正常启动，或者用户是新增的。</span></td>
            </tr>
          </table>
        </div>
      </div>

      <hr>

      <p class="text-warning" ng-hide="user_index.length != 0">
        <i class="fa fa-exclamation-circle fa-4x"></i>
        <span>
          目前还没有已经登记注册的用户。
        </span>
      </p>

      <div ng-hide="user_index.length == 0">
        <div class="text-info">
          <h5><b>用户</b></h5>
        </div>

        <table class="table table-hover">
          <tr ng-repeat="e in spider_user_index">
            <td style="width: 5%;"><i class="fa fa-user"></i></td>
            <td style="width: 5%;" ng-switch on="e.spider">
              <span ng-switch-when="running">
                <i class="fa fa-play"></i>
              </span>
              <span class="text-warning" ng-switch-when="idle">
                <i class="fa fa-pause"></i>
              </span>
            </td>
            <td style="width: 30%;"><b>{{e.login}}</b></td>
            <td style="width: 55%;">
              {{e.name}}
            </td>
            <td style="width: 5%;">
              <a href ng-click="send('spider.user.destroy', { id: e.id });">
                <i class="fa fa-trash text-danger pull-right"></i>
              </a>
            </td>
          </tr>
        </table>

        <div class="pull-right">
          <hr>
          <a href ng-click="send('spider.start', {});">
            启动全部用户的个人待办抓取服务
            <i class="fa fa-arrow-circle-right fa-1x"></i>
          </a>
        </div>
      </div>
    </div>
  </div>
</div>
